using System.Text;

namespace OracleInternal.SqlAndPlsqlParser.LocalParsing
{
	public sealed class OracleLpBindParameter : OracleLpStatementElement
	{
		private OracleLpBindParameterType m_vType;

		private OracleLpTextFragment m_vName;

		private int m_vPosition = -1;

		private OracleLpStatementClauseType m_vParentClause;

		internal override OracleLpStatementElementType ElementType => OracleLpStatementElementType.BindParameter;

		public OracleLpBindParameterType ParameterType => m_vType;

		public OracleLpTextFragment Name
		{
			get
			{
				return m_vName;
			}
			internal set
			{
				m_vName = value;
			}
		}

		public int Position
		{
			get
			{
				return m_vPosition;
			}
			internal set
			{
				m_vPosition = value;
			}
		}

		public OracleLpStatementClauseType ParentClause
		{
			get
			{
				return m_vParentClause;
			}
			internal set
			{
				m_vParentClause = value;
			}
		}

		internal OracleLpBindParameter(OracleLpStatement parent, OracleLpRelativeTextFragment name, int position, OracleLpBindParameterType type)
			: base(parent)
		{
			m_vName = name;
			m_vPosition = position;
			m_vType = type;
		}

		public override string ToString()
		{
			return $"\tParameter name: {m_vName}, position: {m_vPosition}, parent clause: {m_vParentClause}\n";
		}

		internal override void ToString(StringBuilder sb)
		{
		}
	}
}
